<?php
defined('SYSPATH') OR die('No direct access allowed.');
/**
 * pelamarproses.php
 * @author ranuandra
 *
 * 12 Mar 2012 14:37:11
 *
 * 
 */

class Model_Pelamarproses extends ORM
{
	protected $_belongs_to = array(
							'proseslowongan'		=> array('model' 	=> 'proseslowongan'),
							'mstpelamar' 			=> array('model'	=> 'mstpelamar'),
							'pelamarlowongan'		=> array('model'	=> 'pelamarlowongan'),
						);
	private $_field = array('pelamarlowongan_id', 'mstproses_id', 'tgl_proses', 'flag_hadir', 'lokasi_proses', 'flag_panggil', 'flag_sms', 'tgl_panggil', 'panggil_proses');
	private $_form = array(
							'pelamarlowongan_id' => '', 
							'proseslowongan_id' => '', 
							'tgl_proses' => '', 
							'flag_hadir' => '', 
							'lokasi_proses' => '', 
							'flag_panggil' => '', 
							'flag_sms' => '', 
							'tgl_panggil' => '', 
							'panggil_proses' => ''
						);
	
	public function rules()
	{
		return array(
			'areaofwork' => array(
							array('min_length', array(':value', 0)),
						),
						
							'pelamarlowongan_id' => array(
															array('min_length', array(':value', 0)),
														), 
							'proseslowongan_id' => array(
															array('min_length', array(':value', 0)),
														), 
							'tgl_proses' => array(
															array('min_length', array(':value', 0)),
														), 
							'flag_hadir' => array(
															array('min_length', array(':value', 0)),
														), 
							'lokasi_proses' => array(
															array('min_length', array(':value', 0)),
														), 
							'flag_panggil' => array(
															array('min_length', array(':value', 0)),
														), 
							'flag_sms' => array(
															array('min_length', array(':value', 0)),
														), 
							'tgl_panggil' => array(
															array('min_length', array(':value', 0)),
														), 
							'panggil_proses' => array(
															array('min_length', array(':value', 0)),
														),
		
		); 
	}
	
	public function getField()
	{
		return $this->_field;
	}
	
	public function getForm()
	{
		return $this->_form;
	}
	
	public function create_data($values)
	{
	    return $this->values($values, $this->_field)->create();
	}	
}